/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projetlif13.model;

import projetlif13.tools.Utility;

/**
 *
 * @author theo et Yohan B.
 */
public abstract class IAPlayer extends Player implements Runnable {

    public static final int DIFFICULTY_EASY = 1;
    public static final int DIFFICULTY_MEDIUM = 2;
    public static final int DIFFICULTY_ADVANCED = 3;
    public static int difficulty;
    //Thread IA
    protected Thread localthread;
    protected boolean stop;
    private boolean alreadylaunched = false;

    public IAPlayer() {
        localthread = new Thread(this);
        name = "*IA* " + Utility.getRandomName();
        localthread.setName(name);

    }

    public Thread getLocalthread() {
        return localthread;
    }

    public void start() {
        if (alreadylaunched) {
            stop = false;
            //System.out.println("Already launched");
            localthread = new Thread(this);
            localthread.setName(name + " relaunched!");
            localthread.start();
        } else {
            localthread.start();
            alreadylaunched = true;
        }


    }

    public void stop() {
        stop = true;
    }
}
